package Unused;

import GameObjects.Player;

import com.jme.input.action.InputActionEvent;
import com.jme.math.Matrix3f;
import com.jme.math.Vector3f;
import com.jme.scene.Node;


public class VehicleRotateRightAction {
	private Player ds;
	VehicleRotateRightAction(Node n)
	{
		ds = (Player)n;
	
	}
	
    public void performAction(InputActionEvent evt) {
        //we want to turn differently depending on which direction we are traveling in.
        if(ds.getVelocity() < 0) {
            incr.fromAngleNormalAxis(-ds.getTurnSpeed() * evt.getTime(), new Vector3f(0,1,0));
        } else {
            incr.fromAngleNormalAxis(ds.getTurnSpeed() * evt.getTime(), new Vector3f(0,1,0));
        }
        ds.getLocalRotation().fromRotationMatrix(
                incr.mult(ds.getLocalRotation().toRotationMatrix(new Matrix3f()),
                		new Vector3f(0,1,0)));
        ds.getLocalRotation().normalize();
 
    }
}
